package com.ruoyi.cms.domain;

import com.ruoyi.common.xss.Xss;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Size;

/**
 * 游客留言对象 cms_site_visitor_message
 *
 * @author ruoyi
 * @date 2022-09-02
 */
public class CmsSiteVisitorMessage extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
    private Long id;

    /**
     * 处理状态（0待处理 1已处理）
     */
    @Excel(name = "处理状态", readConverterExp = "0=待处理,1=已处理")
    private String status;

    /**
     * 姓名
     */
    @Excel(name = "姓名")
    private String name;

    /**
     * 邮箱
     */
    @Excel(name = "邮箱")
    private String email;

    /**
     * 电话
     */
    @Excel(name = "电话")
    private String phone;

    /**
     * 留言内容
     */
    @Excel(name = "留言内容")
    private String message;

    /**
     * 处理备注
     */
    @Excel(name = "处理备注")
    private String handRemark;

    public void setId(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getStatus() {
        return status;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Xss(message = "姓名不能包含脚本字符")
    @NotEmpty(message = "姓名不能为空")
    @Size(min = 0, max = 64, message = "姓名长度不能超过64个字符")
    public String getName() {
        return name;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    @NotEmpty(message = "邮箱不能为空")
    @Email(message = "邮箱格式不正确")
    @Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符")
    public String getEmail() {
        return email;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    @Xss(message = "姓名不能包含脚本字符")
    @NotEmpty(message = "电话号码不能为空")
    @Size(min = 0, max = 64, message = "电话号码长度不能超过64个字符")
    public String getPhone() {
        return phone;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    @Xss(message = "留言不能包含脚本字符")
    @NotEmpty(message = "留言不能为空")
    @Size(min = 0, max = 512, message = "留言长度不能超过512个字符")
    public String getMessage() {
        return message;
    }

    public void setHandRemark(String handRemark) {
        this.handRemark = handRemark;
    }

    public String getHandRemark() {
        return handRemark;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("createTime", getCreateTime())
                .append("status", getStatus())
                .append("name", getName())
                .append("email", getEmail())
                .append("phone", getPhone())
                .append("message", getMessage())
                .append("handRemark", getHandRemark())
                .toString();
    }
}
